<?php
/*! \brief
 * This is abstract class of Widget Framewok /path/to/widget_old
 * You can get all of the object of Widget Framework via this class
 *\author William Su
 */
abstract class AWFFrom
{
    /**
     * @var WF
     */
    protected $objFramework;
    protected static $instance;
    public function __construct($objFramework){
        $this->objFramework = $objFramework;
    }
    public function getDocumentRoot(){
        $srcFolderNameWidgetOldInstall = $this->objFramework->getMigrateFactory()->getFolderNameWidgetOldInstall();
        $ret = $this->objFramework->getDocumentRoot() . '/../' . $srcFolderNameWidgetOldInstall;
        return $ret;
    }
    public function getWFVersion(){
        $strPathWFInfo = $this->getDocumentRoot() . '/common/include/WFInfo.ini';
        if(false === file_exists($strPathWFInfo)){
            $ret = '1.6';
        }else{
            $arrsTmInfo = parse_ini_file($strPathWFInfo, true);
            $ret = $arrsTmInfo['Version']['TM_VERSION_MAJOR'] . '.' . $arrsTmInfo['Version']['TM_VERSION_MINOR'];
        }
        return $ret;
    }
    abstract public function getDataObject();
}